#!/bin/bash


config_file=${BITBUCKET_HOME}/shared/bitbucket.properties

# remove exists config
sed -i '/^server\.scheme/d' $config_file
sed -i '/^server\.proxy/d' $config_file

if [ "$PROXY_ENABLED" = 'true' ]; then
    echo "server.scheme=${PROXY_SCHEME}" >> $config_file
    echo "server.proxy-port=${PROXY_PORT}" >> $config_file
    echo "server.proxy-name=${PROXY_NAME}" >> $config_file
fi
